<include href="base/header.html"/>
        <div class="form" id="map_parameters">
            <form action="" method="post">
                <table>
                    <thead>
                        <tr>
                            <th>Parameter</th>
                            <th>Value</th>
                        </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td><label for="start_time">Start datetime: </label></td>
                        <td>
                            <select name="start_time" id="start_time">
                                <repeat group="{{ @datetimes }}" value="{{ @datetime }}">
                                    <check if="{{ @isPost && @datetime['time'] == @startTime }}">
                                        <true>
                                            <option value="{{ @datetime['time'] }}" selected="selected">
                                                {{ @datetime['time'] }}</option>
                                        </true>
                                        <false>
                                            <option value="{{ @datetime['time'] }}">{{ @datetime['time'] }}</option>
                                        </false>
                                    </check>
                                </repeat>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><label for="end_time">End datetime: </label></td>
                        <td>
                            <select name="end_time" id="end_time">
                                <repeat group="{{ @datetimes }}" value="{{ @datetime }}">
                                    <check if="{{ @isPost && @datetime['time'] == @endTime }}">
                                        <true>
                                            <option value="{{ @datetime['time'] }}" selected="selected">
                                                {{ @datetime['time'] }}</option>
                                        </true>
                                        <false>
                                            <option value="{{ @datetime['time'] }}">{{ @datetime['time'] }}</option>
                                        </false>
                                    </check>
                                </repeat>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><label for="car">Cars: </label></td>
                        <td>
                            <select name="car" id="car">
                                <repeat group="{{ @cars }}" value="{{ @car }}">
                                    <check if="{{ @isPost && @car->id == @carId }}">
                                        <true>
                                            <option value="{{ @car->id }}" selected="selected">
                                                {{ @car->description }}</option>
                                        </true>
                                        <false>
                                            <option value="{{ @car->id }}">{{ @car->description }}</option>
                                        </false>
                                    </check>
                                </repeat>
                            </select>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <button type="submit">Submit</button>
            </form>
        </div>

<check if="{{ @isPost }}">
    <div id="map_canvas" style="height: {{ @mapHeight }}; width: {{ @mapWidth }}"></div>
    <div>
        <table id="stops">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Latitude</th>
                    <th>Longitude</th>
                    <th>Address</th>
                    <th>Time</th>
                    <th>Length</th>
                </tr>
            </thead>
            <tbody>
            <repeat group="{{ @car_stops }}" key="{{ @stop_id }}" value="{{ @stop }}">
                <check if="{{ @stop['status'] == 0 }}">
                <tr>
                    <td>{{ @stop_id + 1 }}</td>
                    <td>{{ @stop['latitude'] }}</td>
                    <td>{{ @stop['longitude'] }}</td>
                    <td>{{ @stop['address'] }}</td>
                    <td>{{ @stop['time'] }}</td>
                    <td>{{ Time::fromSeconds(@stop['length']) }}</td>
                </tr>
                </check>
            </repeat>
            </tbody>
        </table>
    </div>
    <script type="text/javascript"
            src="/assets/js/vendor/markerwithlabel.js">
    </script>
    <script type="text/javascript">
        var carStops = {{ json_encode(@car_stops) }},
            color1 = "{{ @color1 }}",
            color2 = "{{ @color2 }}",
            minSymbolRadius = {{ @minSymbolRadius }},
            maxSymbolRadius = {{ @maxSymbolRadius }},
            opacity = {{ @opacity }},
            minStopLength = {{ @min_stop_length }},
            maxStopLength = {{ @max_stop_length }};

        //console.log(carStops);
    </script>
    <script type="text/javascript"
            src="/assets/js/main.js">
    </script>
</check>
<include href="base/footer.html"/>